--[[ Lambda Minimap
     Part of LambdaUI made by Gaius
	 Graphics are made by Gaius
	 ------------------------------
	 Contact me in irc://phcnet.de/#wow-interface
--]]

local filePath = "Interface\\Addons\\LambdaUI\\"

--[[  Lambda Minimap Prototype

--]]
local Lambda = {}

function Lambda:new()
	local Lambda = {}
    local filePath = filePath.."MiniMap\\"
	
	Lambda = Minimap
	
	Lambda:SetParent(UIParent)
	MinimapBackdrop:ClearAllPoints()
	MinimapBackdrop:SetPoint("CENTER",Lambda, "CENTER", -8, -24)
	MinimapBorder:Hide()
	MinimapBorder.Show = function() end
	
	MinimapZoomIn:Hide()
	MinimapZoomIn.Show = function() end
	
	MinimapZoomOut:Hide()
	MinimapZoomOut.Show = function() end
	
	MiniMapWorldMapButton:Hide()
	MiniMapWorldMapButton.Show = function() end
	
	MiniMapTracking:Hide()
	MiniMapTracking.Show = function() end
	
	
	MinimapBackdrop:SetWidth(190)
	MinimapBackdrop:SetHeight(190)
	MinimapCluster:Hide()
	
	Lambda.ZoomOut = CreateFrame("Button", "LambdaMinimapZoomOut", Lambda)
	Lambda.ZoomIn = CreateFrame("Button", "LambdaMinimapZoomIn", Lambda)
	Lambda.Settings = CreateFrame("Button", "LambdaMinimapSettings", Lambda)
	Lambda.Border = Lambda:CreateTexture("LambdaMinimapBorder","BORDER")
	Lambda.Background = Lambda:CreateTexture("LambdaMinimapBackground","BACKGROUND")
	Lambda.NorthTag = CreateFrame("Button", "LambdaMinimapNorthTag", Lambda)
	Lambda:SetWidth(147)
	Lambda:SetHeight(147)
	Lambda:SetPoint("BOTTOMLEFT",UIParent,"BOTTOMLEFT", 33, 116)
		
	Lambda.Border:SetTexture(filePath.."Border.tga")
	Lambda.Border:SetPoint("TOPLEFT",Lambda)
	Lambda.Border:SetWidth(256)
	Lambda.Border:SetHeight(256)
	
	Lambda.Background:SetTexture(filePath.."Background.tga")
	Lambda.Background:SetPoint("TOPLEFT",Lambda)
	Lambda.Background:SetWidth(256)
	Lambda.Background:SetHeight(256)
	
	Lambda.ZoomOut:SetNormalTexture(filePath.."ZoomOut.tga")
	Lambda.ZoomOut:SetWidth(32)
	Lambda.ZoomOut:SetHeight(32)
	Lambda.ZoomOut:SetPoint("TOPLEFT",Lambda,"TOPLEFT",90, 2)
	Lambda.ZoomOut:SetScript("OnClick", function()
		if Lambda:GetZoom() >= 0 and Lambda:GetZoom() < 5 then
			Lambda:SetZoom(Lambda:GetZoom() +1)
		end
	end )
	
	Lambda.ZoomIn:SetNormalTexture(filePath.."Minimize.tga")
	Lambda.ZoomIn:SetWidth(32)
	Lambda.ZoomIn:SetHeight(32)
	Lambda.ZoomIn:SetPoint("TOPLEFT",Lambda,"TOPLEFT",110, -10)
	Lambda.ZoomIn:SetScript("OnClick", function()
		if Lambda:GetZoom() <= 5 and Lambda:GetZoom() > 0 then
			Lambda:SetZoom(Lambda:GetZoom() -1)
		end
	end )
	Lambda.ZoomIn:SetFrameLevel(3)
	
	Lambda.Settings:SetNormalTexture(filePath.."Settings.tga")
	Lambda.Settings:SetWidth(32)
	Lambda.Settings:SetHeight(32)
	Lambda.Settings:SetPoint("TOPLEFT",Lambda,"TOPLEFT",126, -28)
	Lambda.Settings:SetScript("OnClick", function()
			if LambdaUIConfigurationFrame then
				LambdaUIConfigurationFrame:Show()
			end
	end )
	Lambda.Settings:SetFrameLevel(4)
	
	
	Lambda.NorthTag:SetNormalTexture(filePath.."NorthTag.tga")
	Lambda.NorthTag:SetWidth(32)
	Lambda.NorthTag:SetHeight(32)
	Lambda.NorthTag:SetPoint("TOP",Lambda,"TOP",1, 12)
	
	Lambda.NorthTag:SetScript("OnEnter", function()
		GameTooltip_SetDefaultAnchor(GameTooltip, this);
		MainMenuBarPerformanceBarFrame_OnEnter()
	end)
	Lambda.NorthTag:SetScript("OnClick", function()
		ToggleDropDownMenu(1, nil, MiniMapTrackingDropDown, Lambda.NorthTag:GetName(), 0, 0);
	end)
	Lambda.NorthTag:SetScript("OnLeave", function()
		GameTooltip:Hide()
	end)
	
	
	table.insert(LambdaObjectTable,"LambdaMinimap")
	
	return Lambda
end 

LambdaMinimap = Lambda:new()

MiniMapCompassRing:Hide()
MiniMapCompassRing.Show = function() end

MinimapNorthTag:Hide()
MinimapNorthTag.Show = function() end

